wayland: Fix "fake root" coords
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 17 Mar 2014 19:27:13 +0000 (15:27 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 17 Mar 2014 19:36:41 +0000 (15:36 -0400)
We were incorrectly summing up our own window over and over
rather than the coordinates of the parent windows.

gdk/wayland/gdkwindow-wayland.c

index 9e4c07e1c4fe1d6b2415ed66d454802b20c1f70d..b6d3811a73ef3d828de3a44b206091fff6eb0795 100644 (file)
@@ -1098,21 +1098,17 @@ gdk_wayland_window_get_fake_root_coords (GdkWindow *window,
                                          gint      *x_out,
                                          gint      *y_out)
 {
-  GdkWindowImplWayland *impl, *parent_impl;
-  GdkWindow *parent_window;
   gint x_offset = 0, y_offset = 0;
 
-  impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
-
-  parent_window = impl->transient_for;
-  while (parent_window)
+  while (window)
     {
-      parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent_window->impl);
+      GdkWindowImplWayland *impl;
 
       x_offset += window->x;
       y_offset += window->y;
 
-      parent_window = parent_impl->transient_for;
+      impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+      window = impl->transient_for;
     }
 
   *x_out = x_offset;